<template>
	<view class="page">
		<u-navbar title="我的" :is-back="false" background="rgba(0,0,0,0)" title-color="#fff"
			:border-bottom="false"></u-navbar>
		<view class="profession_class">
			<image src="http://8.155.28.7:45/group1/M00/00/00/rBLpe2dW7VyAD2ddAAB9YGmDJjM668.jpg"
				style="border-radius:170rpx;width:170rpx;height:170rpx;"></image>
			<view style="line-height:60rpx;flex-grow:1;margin-left:40rpx;">
				<view style="display:flex;align-items:center;">
					<text style="font-size:38rpx;margin-right:20rpx;color:#fff;">{{userInfo.userName}}</text>
					<view class="">
						<text
							style="background-color:#ff9b06;border-radius:20rpx;font-size:20rpx;padding:5rpx 15rpx;color:#fff;">
							{{userInfo.realName=="2"?'已实名':'未认证'}}</text>
					</view>
				</view>
				<view style="color:#fff;font-size:28rpx;">
					15861274533
				</view>
			</view>
		</view>
		<view style="background-color:#F6F9FF;border-radius:30rpx 30rpx 0 0;padding-top:40rpx;">
			<view class="nav_list_class" @click="toUserInfo()">
				<image style="width:35rpx;height:35rpx;" mode="aspectFit" src="../../static/about03.png"></image>
				<text style="flex-grow:1;">个人资料</text>
				<u-icon name="arrow-right" color="#cccccc"></u-icon>
			</view>
			<view class="nav_list_class" @click="toAuthentication()">
				<image style="width:35rpx;height:35rpx;" mode="aspectFit" src="../../static/about04.png"></image>
				<text style="flex-grow:1;">实名认证</text>
				<u-icon name="arrow-right" color="#cccccc"></u-icon>
			</view>
			<view class="nav_list_class" @click="toRegisterAbout()">
				<image style="width:35rpx;height:35rpx;" mode="aspectFit" src="../../static/about04.png"></image>
				<text style="flex-grow:1;">工人登记</text>
				<u-icon name="arrow-right" color="#cccccc"></u-icon>
			</view>
			<view class="nav_list_class" @click="toGongxin()">
				<image style=" width:35rpx;height:35rpx;" mode="aspectFit" src="../../static/about05.png">
				</image>
				<text style="flex-grow:1;">工信分</text>
				<u-icon name="arrow-right" color="#cccccc"></u-icon>
			</view>
			<view class="nav_list_class" @click="logOut()">
				<image style="width:35rpx;height:35rpx;" mode="aspectFit" src="../../static/about09.png"></image>
				<text style="flex-grow:1;">退出登录</text>
				<u-icon name="arrow-right" color="#cccccc"></u-icon>
			</view>

		</view>


	</view>
</template>
<script>
	export default {
		data() {
			return {
				customStyle: {
					border: 0,
					padding: 0,
					margin: 0,
					width: '100%',
					fontSize: '27rpx',
					color: '#222',
					height: '38rpx'
				},
				form: {},
				rules: [],
				userInfo: {}
			}
		},
		onShow() {
			this.userInfo = uni.getStorageSync('user');
		},
		methods: {
			// 跳转切换身份页
			toSwitchIdentity() {
				uni.navigateTo({
					url: '/pages/about/switchIdentity?id=2'
				});
			},
			// 跳转个人资料页
			toUserInfo() {
				uni.navigateTo({
					url: '/pages/about/userInfo'
				});
			},
			// 跳转实名认证页
			toAuthentication() {
				uni.navigateTo({
					url: '/pages/about/authentication'
				});
			},
			// 工人登记
			toRegisterAbout() {
				uni.navigateTo({
					url: '/pages/template2/register'
				});
			},
			// 跳转工信分页
			toGongxin() {
				uni.navigateTo({
					url: '/pages/about/gongxin'
				});
			},
			// 退出登录
			logOut() {
				uni.clearStorageSync();
				uni.reLaunch({
					url: '/pages/login/index'
				});
			},
			// 客服
			toCustomerService() {
				uni.navigateTo({
					url: '/pages/about/customerService'
				});
			},
			toCollection() {
				uni.navigateTo({
					url: '/pages/about/collection'
				});
			},
			toMyBond() {
				uni.navigateTo({
					url: '/pages/about/myBond'
				});
			},
			toYongjinjilu() {
				uni.navigateTo({
					url: '/pages/about/yongjinjilu'
				});
			},
		},
		onShareAppMessage(res) {
			if (res.from === 'button') { // 来自页面内分享按钮
				console.log(res.target)
			}
			return {
				title: '自定义分享标题',
				path: '/pages/home/index'
			}
		},
	}
</script>

<style lang="scss" scoped>
	.page {
		min-height: 100%;
		background: url(http://8.155.28.7:45/group1/M00/00/00/rBLpe2dW8IWADylaAAFfGiRTYtM592.png) no-repeat;
		background-size: 100%;
		background-color: #F6F9FF;
	}

	.profession_class {
		margin: 0 50rpx;
		display: flex;
		align-items: center;
		height: 250rpx;
	}

	.nav_list_class {
		box-shadow: 0px 0px 6px #e9e9e9;
		display: flex;
		justify-content: space-between;
		align-items: center;
		background-color: #fff;
		margin: 30rpx 40rpx;
		padding: 30rpx;
		border-radius: 15rpx;

		image {
			margin-right: 20rpx;
		}
	}
</style>